import {Component, Input, OnInit, SimpleChanges} from '@angular/core';

@Component({
  selector: 'app-user',
  templateUrl: './user.component.html',
  styleUrls: ['./user.component.css']
})

export class UserComponent implements OnInit {
  selected = -1;
  @Input() backgroundColor = "#000";
  @Input() titleActiveColor = "green";
  @Input() titleColor = "red";

  // 组件构造函数
  constructor() {
  //  构造函数
  }

  ngOnInit() {
  // 组件初始化函数

  }
  ngOnChanges(changes: SimpleChanges):void{
    console.log("组件输入的时候属性变化",changes)
  }
}
